package org.jeecg.modules.demo.jg.controller;

import org.jeecg.modules.demo.jg.service.WaterService;
import org.jeecg.modules.demo.jg.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/water")
public class WaterController {
    @Autowired
    WaterService waterService;

    public static final Integer successCode = 200;

    @GetMapping(value="/waterInDis",produces="application/json; charset=utf-8")
    public JsonResult waterInDis() {
        List list = waterService.waterInDis();
        return new JsonResult(successCode,list);
    }

    @GetMapping(value="/findAllEnterprise",produces="application/json; charset=utf-8")
    public JsonResult findAllEnterprise() {
        List linkedlist = waterService.findAllEnterprise();
        return new JsonResult(successCode,linkedlist);
    }

    @GetMapping(value="/fndTopFive",produces="application/json; charset=utf-8")
    public JsonResult fndTopFive() {
        List<List> regionList = waterService.fndTopFive();
        return new JsonResult(successCode,regionList);
    }

    @GetMapping(value="/findWaterType",produces="application/json; charset=utf-8")
    public JsonResult findWaterType() {
        List arrList = waterService.findWaterType();
        return new JsonResult(successCode,arrList);
    }

    @GetMapping(value="/findMainDischarge",produces="application/json; charset=utf-8")
    public JsonResult findMainDischarge() {
        List<List> arrList = waterService.findMainDischarge();
        return new JsonResult(successCode,arrList);
    }

    @GetMapping(value="/findMiddleData", produces="application/json; charset=utf-8")
    public JsonResult findMiddleData() {
        List<List> arrList = waterService.findMiddleData();
        return new JsonResult(successCode,arrList);
    }
}
